﻿using System;
using System.IO;

class Program
{
    static void Main()
    {
        FileSystemWatcher watcher = new FileSystemWatcher();
        watcher.Path = @"..\..\";
        watcher.Filter = "Program.cs";
        watcher.Changed += new FileSystemEventHandler(OnWatcherChanged);
        watcher.EnableRaisingEvents = true;
        while (Console.ReadKey().Key != ConsoleKey.Q) ;       
    }

    static void OnWatcherChanged(object sender, FileSystemEventArgs e)
    {
        Console.WriteLine(e.FullPath+" was changed.");
    }
}